## -*- coding: utf-8 -*-
from google.appengine.ext import db

class Diary(db.Model):
    title = db.StringProperty(u"タイトル", required=True)
    content = db.TextProperty(u"内容", required=True)
    pub_date = db.DateTimeProperty(u"表示日時", required=True)
    is_active = db.BooleanProperty(u"表示・非表示", default=True)

    creator = db.UserProperty(u"作成者")
    modifier = db.UserProperty(u"更新者")
    created_at = db.DateTimeProperty(u"作成日時", auto_now_add=True)
    modified_at = db.DateTimeProperty(u"更新日時", auto_now=True)


class Comment(db.Model):
    diary = db.ReferenceProperty(Diary, u"記事")
    content = db.TextProperty(u"内容", required=True)
    pub_date = db.DateTimeProperty(u"表示日時", required=True)
    is_active = db.BooleanProperty(u"表示・非表示", default=True)

    creator = db.UserProperty(u"作成者")
    modifier = db.UserProperty(u"更新者")
    created_at = db.DateTimeProperty(u"作成日時", auto_now_add=True)
    modified_at = db.DateTimeProperty(u"更新日時", auto_now=True)
